<?php
/**
 * Routes configuration
 *
 * In this file, you set up routes to your controllers and their actions.
 * Routes are very important mechanism that allows you to freely connect
 * different urls to chosen controllers and their actions (functions).
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       cake
 * @subpackage    cake.app.config
 * @since         CakePHP(tm) v 0.2.9
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
/**
 * Here, we are connecting '/' (base path) to controller called 'Pages',
 * its action called 'display', and we pass a param to select the view file
 * to use (in this case, /app/views/pages/home.ctp)...
 */

	Router::connect('/', array('controller' => 'home', 'action' => 'index', 'home'));
	Router::connect('/login', array('plugin' => 'users', 'controller' => 'users', 'action' => 'login'));
	Router::connect('/logout', array('plugin' => 'users', 'controller' => 'users', 'action' => 'logout'));
	Router::connect(
		'/lg/:lang', 
		array(
			'controller' => 'home', 
			'action'	=> 'index',
		),
		array(
			'lang'	=>	'vi|en'
		)
	);
	
	Router::connect(
		'/about-:location',
		array('plugin' => null, 'controller' => 'about', 'action' => 'index'),
		array(
			'pass' => array('location'),
		)
	);
    
    Router::connect(
		'/contact_us',
		array('plugin' => 'contacts', 'controller' => 'contacts', 'action' => 'add')
	);
    Router::connect('/news/list/*', array('plugin' => 'news','controller' => 'news', 'action' => 'listnews'));
    Router::connect('/news/detail/*', array('plugin' => 'news','controller' => 'news', 'action' => 'view'));
	 
    Router::connect('/sciences/list/*', array('plugin' => 'sciences','controller' => 'sciences', 'action' => 'index'));
    Router::connect('/sciences/detail/*', array('plugin' => 'sciences','controller' => 'sciences', 'action' => 'view'));
    
    Router::connect('/features/list/*', array('plugin' => 'features','controller' => 'features', 'action' => 'index'));
    Router::connect('/features/detail/*', array('plugin' => 'features','controller' => 'features', 'action' => 'view'));
	 
    Router::connect('/product/list/*', array('plugin' => 'products','controller' => 'products', 'action' => 'listproducts'));
    Router::connect('/product/detail/*', array('plugin' => 'products','controller' => 'products', 'action' => 'view'));
    Router::connect('/cart', array('plugin' => 'products','controller' => 'products', 'action' => 'cart'));  
    Router::connect('/order', array('plugin' => 'products','controller' => 'products', 'action' => 'order')); 
    Router::connect('/product/cart/*', array('plugin' => 'products','controller' => 'products', 'action' => 'add_cart'));    
    Router::connect('/product/remove/*', array('plugin' => 'products','controller' => 'products', 'action' => 'remove'));   
    Router::connect('/search', array('plugin' => 'products','controller' => 'products', 'action' => 'search'));   
    
    Router::connect('/information/*', array('plugin' => 'static_pages','controller' => 'static_pages', 'action' => 'view'));       
	// Route Simple Pages
	//Router::connect('/edit/*', array('controller' => 'manage_edit_content', 'action' => 'index'));
/**
 * ...and connect the rest of 'Pages' controller's urls.
 */
	//Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
	//Router::connect('/', array('controller'=>'users', 'action'=>'index'));
?>